
********************************************************************************
****** The Effects of WWII on Economic and Health Outcomes across Europe *******
********************************************************************************
* Authors: Iris Kesternich, Bettina Siflinger, James P. Smith, Joachim Winter
* Review of Economics and Statistics, 2014
********************************************************************************
* DOFILE: FIGURE 2, HUNGER PANEL WAR-NONWAR COUNTRIES
********************************************************************************


clear
clear matrix
clear mata
set more off


*** define the path to the directory containing the data files here 
*** or leave "." if the do files are in the current directory 

global datapath "."

*** define the path to the directory to which figures are saved here 
*** or leave "." if they should be saved to the current directory 

global graphpath  "."


use "$datapath\final\share_panel.dta", clear



* generate war country indicator
gen war_countries = .
replace war_countries = 0 if country == 13 | country == 18 | country == 20
replace war_countries = 1 if (country == 11 | country == 12 | country == 14 | country == 16 | ///
country == 17 | country == 19 | country == 23 | country == 28 | country == 29)







********************************************************************************
*** FIGURE 2: PERCENTAGE OF SHARE RESPONDENTS SUFFERING FROM HUNGER: WAR 
			  * VS NONWAR COUNTRIES
********************************************************************************




*** FIGURE 2a: HUNGER, WAR COUNTRIES
sort country year
by country year: egen country_mean_hunger = mean (hunger_period)

graph twoway (line country_mean_hunger year if country == 11 & nativeborn == 1 & yrbirth3 > 1920) ///
			 (line country_mean_hunger year if country == 12 & nativeborn == 1 & yrbirth3 > 1920, lcolor(black))  ///
			 (line country_mean_hunger year if country == 14 & nativeborn == 1 & yrbirth3 > 1920)  ///
			 (line country_mean_hunger year if country == 16 & nativeborn == 1 & yrbirth3 > 1920)  ///
			 (line country_mean_hunger year if country == 17 & nativeborn == 1 & yrbirth3 > 1920) ///
			 (line country_mean_hunger year if country == 19 & nativeborn == 1 & yrbirth3 > 1920) ///
			 (line country_mean_hunger year if country == 23 & nativeborn == 1 & yrbirth3 > 1920) ///
			 (line country_mean_hunger year if country == 28 & nativeborn == 1 & yrbirth3 > 1920) ///
			 (line country_mean_hunger year if country == 29 & nativeborn == 1 & yrbirth3 > 1920) if year >= 1920 & year <= 1960, ///
legend( pos(2) col(1) ring(0) symxsize(8) size(small) margin(tiny) keygap(1) order(1 "AUS" 2 "GER" 3 "NED" 4 "ITA" 5 "FRA" 6 "GRE" 7 "BEL" 8 "CZE" 9 "POL")) ///
title(Hunger: War countries ) yscale(range(.00 .24)) ylabel(.00(.02)0.24) ytitle(Hunger) xtitle(Year) xsize(8) ysize(5)
graph export "$graphpath\fig2_hunger_single_war_countries.png", width(600) replace

drop country_mean_hunger





*** FIGURE 2b: HUNGER, WAR VS NONWAR COUNTRIES (NO SPAIN)
sort war_countries year
by war_countries year: egen country_mean_hunger = mean (hunger_period)

graph twoway (line country_mean_hunger year if war_countries == 0 & nativeborn == 1 & yrbirth3 > 1920) ///
			 (line country_mean_hunger year if war_countries == 1 & nativeborn == 1 & yrbirth3 > 1920) if year >= 1920 & year <= 1960, ///
legend( pos(2) col(1) ring(0) symxsize(8) size(small) margin(tiny) keygap(1) order(1 "Nonwar countries" 2 "War countries")) ///
title(Hunger: War vs. nonwar countries) yscale(range(.00 .24)) ylabel(.00(.02)0.24) ytitle(Hunger) xtitle(Year) xsize(8) ysize(5)
graph export "$graphpath\fig2_hunger_war_nonwar.png", width(600) replace

drop country_mean_hunger





*** FIGURE 2c: HUNGER, REGIONAL COMBATS EXPERIENCED

tab comb_yrs
gen comb_0 = 0 if comb_yrs == 0
replace comb_0 = 1 if comb_yrs >= 1 & comb_yrs ~= .


sort comb_0 year
by comb_0 year: egen yrscomb_mean_hunger = mean(hunger_period) 

graph twoway (line yrscomb_mean_hunger year if comb_0 == 0 & nativeborn == 1 & yrbirth3 > 1920) ///
			 (line yrscomb_mean_hunger year if comb_0 == 1 & nativeborn == 1 & yrbirth3 > 1920) if year >= 1920 & year <= 1960 & country ~= 15, ///
			 legend( pos(2) col(1) ring(0) symxsize(8) size(small) margin(tiny) keygap(1) order(1 "No combats experienced" 2 "Combats experienced")) ///
title(Hunger: Regional combats experienced) yscale(range(.00 .24)) ylabel(.00(.02)0.24) ytitle(Hunger) xtitle(Year) xsize(8) ysize(5)
graph export "$graphpath\fig2_hunger_combats.png", width(600) replace

drop yrscomb_mean_hunger





*** FIGURE 2d: HUNGER, SOCIOECONOMIC STATUS

gen ses_cat = .
replace ses_cat = 1 if ses_low  == 1 & ses_low  ~= .
replace ses_cat = 2 if ses_med  == 1 & ses_med  ~= .
replace ses_cat = 3 if ses_high == 1 & ses_high ~= .
tab ses_cat


sort ses_cat year
by ses_cat year: egen ses_cat_mean_hunger = mean(hunger_period) 

graph twoway (line ses_cat_mean_hunger year if ses_cat == 1 & nativeborn == 1 & yrbirth3 > 1920, lc(black) lw(medium) lpattern(solid)) ///
			 (line ses_cat_mean_hunger year if ses_cat == 2 & nativeborn == 1 & yrbirth3 > 1920, lc(black) lw(medium) lpattern(dash)) ///
			 (line ses_cat_mean_hunger year if ses_cat == 3 & nativeborn == 1 & yrbirth3 > 1920, lc(black) lw(medium) lpattern(......-)) if year >= 1920 & year <= 1960, ///
			 legend( pos(2) col(1) ring(0) symxsize(8) size(small) margin(tiny) keygap(1) order(1 "Low SES" 2 "Medium SES" 3 "High SES")) ///
title(Hunger: Socioeconomic status, c(black)) yscale(range(.00 .24)) ylabel(.00(.02)0.24) ytitle(Hunger) xtitle(Year) xsize(8) ysize(5) graphregion(fc(white)) ylabel(,glc(gs14))
graph export "$graphpath\fig2_hunger_ses.png", width(600) replace
drop ses_cat_mean_hunger


